﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RFIDStockManagement.IDAL;
using System.Data.Common;

namespace RFIDStockManagement.DAL
{
    public class CheckDB : ICheckDB
    {
        public bool VerifyDB(string strConn)
        {
            bool result = false;
            try
            {
                DbHelper helper = new DbHelper(strConn);
                DbCommand comm = helper.GetSqlStringCommand("SELECT TOP 1 1 FROM rfid_Item");
                helper.ExecuteNonQuery(comm);
                result = true;
            }
            catch (Exception ex)
            {
                result = false;
            }

            return result;
        }
        public void SetConnection(string strConn)
        {
            DbHelper.dbConnectionString = strConn;
        }
    }
}
